package leetcode.code2283;

public class Solution {

	public boolean digitCount(String num) {
		int[] h = new int[11];
		for (char c : num.toCharArray()) {
			h[c - '0']++;
		}
		for (int i = 0; i < num.length(); i++) {
			if (h[i] != num.charAt(i) - '0') {
				return false;
			}
		}
		return true;
	}

}
